<?php
define('READY2BLUE',true);
include('include/init.inc.php');
if(isset($_SESSION['cwd'])&&is_dir($_SESSION['cwd']))
{
	$cwd=$_SESSION['cwd'];
}
else
{
	$cwd='..';
	$_SESSION['cwd']=$cwd;
}
chdir($cwd);
$commandHistory=new CommandHistory();
if(isset($command)&&$command)
{

	$commandHistory->Add($command);
	$commandHistory->Rebuild();
	if(!$commandH=new Command($command))
	{
		$cmdResult=new Result();
		$cmdResult->ErrorCode='InitError';
		$cmdResult->Messages=sprintf(L('Init command %1$s failed'),$command);
		$cmdResult->Rst=false;
	}
	else 
	{
		$cmdResult=$commandH->ExecuteCommand();
	}
}
$cwd=getcwd();
$_SESSION['cwd']=$cwd;
$dirs=FileTools::ListDirInfo($cwd);
$files=FileTools::ListFileInfo($cwd);
include(template('list'));
?>